package com.zmn.plat.dubbo.impl;

import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.rpc.RpcContext;

/**
 * 描述: plat 远程接口实现类基类
 *
 * @author wangjie
 * @since 2020/9/25 15:14
 **/
@Slf4j
public class PlatBaseRemoteServiceImpl {

    /**
     * 描述: 获取IP
     *
     * @return java.lang.String
     * @author wangjie
     * @since 2020/9/25 15:15
     **/
    protected String getIPAddress() {

        boolean providerSide = RpcContext.getContext().isProviderSide();
        if (providerSide) {
            return RpcContext.getContext().getRemoteHost();
        }
        return null;
    }
}
